<template>
    <vue-office-docx :src="fileUrl" :options="options" style="height: 100%" @rendered="renderedHandler" @error="errorHandler" />
</template>

<script setup>
//引入VueOfficeDocx组件
import VueOfficeDocx from '@vue-office/docx';
//引入相关样式
import '@vue-office/docx/lib/index.css';
const options = {
    // ignoreWidth: true,
    useBase64URL: true
};

const props = defineProps({
    fileUrl: {
        type: [String, ArrayBuffer],
        default: ''
    }
});

const fileUrl = props.fileUrl;

const renderedHandler = (e) => {
};
const errorHandler = (error) => {
};
</script>
<style>
@media screen and (max-width: 800px) {
    .vue-office-docx .docx-wrapper > section.docx {
        overflow-x: auto;
    }
}
</style>

</script>

<style scoped>
.pdf-preview {
  width: 100%;
  height: 100%;
}
</style>
